<template>
  <el-descriptions class="margin-top" :column="2"  border>
    <template slot="extra">
      <el-button type="primary" size="small" @click="edit(companyuser.cuid)">编辑</el-button>
    </template>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-user"></i>
        用户名
      </template>
      {{companyuser.username}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-view"></i>
        密码
      </template>
      {{companyuser.password}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-user-solid"></i>
        姓名
      </template>
      {{companyuser.name}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-suitcase"></i>
        性别
      </template>
      {{companyuser.sex}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-edit"></i>
        年龄
      </template>
      {{companyuser.age}}
    </el-descriptions-item>
    <el-descriptions-item>
      <template slot="label">
        <i class="el-icon-mobile-phone"></i>
        电话
      </template>
      {{companyuser.phone}}
    </el-descriptions-item>
  </el-descriptions>
</template>
   
  <script>
export default {
  data() {
    return {
      companyuser: ""
      
    };
  },
      created() {
            const _this = this;
            let  c= JSON.parse(window.localStorage.getItem('companyuser'))//获取页面数据
            axios.get('http://localhost:8182/companyuser/findById/'+c.cuid).then(function(resp){
              _this.companyuser=resp.data.data
             /* console.log(resp.data.data ) */
            })
        },
methods:{
  edit(id){
    this.$router.push('/updateCompanyuser?id='+id)
  },
}

}
</script>

  <style scoped>
</style>
